import type { RouteObject } from "react-router";

// 白名单路由
export const ROUTE_WHITE_LIST = {
    LOGIN: '/login',
    REGISTER: '/register',
    NOT_FOUND: '/404',
}

// 菜单项
export interface MenuItem {
    path?: string
    name?: string
    index?: boolean
    icon?: string
    hidden?: boolean,
    visible?: boolean
    type?: string
    element?: any
    redirect?: string
    children?: MenuItem[]
    key?: string
    render?: any
    meta?: {
        title: string
        requiresAuth?: boolean
        roles?: string[]
    }
}

// 路由类型
export type RouteType = RouteObject & {
    Component: React.ComponentType;
    children?: RouteType[];
    meta?: {
        title?: string;
    }
}

// 路由元信息
export interface RouteMeta {
    requiresAuth?: boolean
    roles?: string[]
    permissions?: string[]
    title?: string
}


